import request from '@/utils/request'

// 查询实验数据记录历史列表
export function listHistory(query) {
  return request({
    url: '/human/recordhistory/list',
    method: 'get',
    params: query
  })
}

// 查询实验数据记录历史详细
export function getHistory(historyId) {
  return request({
    url: '/human/recordhistory/' + historyId,
    method: 'get'
  })
}
// 查询实验数据记录历史详细
export function getRecordHistory(dataId) {
  return request({
    url: '/human/recordhistory/getRecordHistory/' + dataId,
    method: 'get'
  })
}

// 新增实验数据记录历史
export function addHistory(data) {
  return request({
    url: '/human/recordhistory',
    method: 'post',
    data: data
  })
}

// 修改实验数据记录历史
export function updateHistory(data) {
  return request({
    url: '/human/recordhistory',
    method: 'put',
    data: data
  })
}

// 删除实验数据记录历史
export function delHistory(historyId) {
  return request({
    url: '/human/recordhistory/' + historyId,
    method: 'delete'
  })
}
// 回溯操作
export function rollback(record) {
  return request({
    url: '/human/recordhistory/rollback',
    method: 'post',
    data: record  // 传递整个历史记录对象
  });
}